from rest_framework import serializers
from app03.models import Cate,Color,Version,Goods

class CateSER(serializers.ModelSerializer):
    class Meta:
        model = Cate
        fields = '__all__'

class ColorSER(serializers.ModelSerializer):
    class Meta:
        model = Color
        fields = '__all__'


class VersionSER(serializers.ModelSerializer):
    class Meta:
        model = Version
        fields = '__all__'


class GoodsSER(serializers.ModelSerializer):
    class Meta:
        model = Goods
        fields = '__all__'

class GoodsShowSER(serializers.ModelSerializer):
    color = ColorSER(many=True)
    version = VersionSER(many=True)
    cate = CateSER()
    class Meta:
        model = Goods
        fields = '__all__'